package com.usian.listener;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MsgListener {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = "2007_queue",durable = "true"),
            exchange = @Exchange(value = "07exchange",type = ExchangeTypes.TOPIC),
            key = {"*.*"}
    ))

    public void listen(String msg){
        System.out.println("又是没用bug接收到消息："+msg);
    }

}
